﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Xml.Linq;

namespace Springbok.Service
{
    public class SLDService : ISLD
    {
        public XElement GetStyleDescription(string style)
        {
            XElement styleDes = XElement.Parse(
    @"<?xml version='1.0' encoding='ISO-8859-1'?>
<StyledLayerDescriptor version='1.0.0'
    xsi:schemaLocation='http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd'
    xmlns='http://www.opengis.net/sld'
    xmlns:ogc='http://www.opengis.net/ogc'
    xmlns:xlink='http://www.w3.org/1999/xlink'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <!-- a Named Layer is the basic building block of an SLD document -->
    <NamedLayer>
        <Name>default_line</Name>
        <UserStyle>
            <!-- Styles can have names, titles and abstracts -->
            <Title>Default Line</Title>
            <Abstract>A sample style that draws a line</Abstract>
            <!-- FeatureTypeStyles describe how to render different features -->
            <!-- A FeatureTypeStyle for rendering lines -->
            <FeatureTypeStyle>
                <Rule>
                    <Name>rule1</Name>
                    <Title>Blue Line</Title>
                    <Abstract>A solid blue line with a 1 pixel width</Abstract>
                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name='stroke'>#0000FF</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>");

            return styleDes;
        }
    }
}
